<template>
    <div class="person_help">
        <x-header :left-options="{backText: ''}" >走帮服</x-header>
          <div class="lesson_lists">
              <group>
                  <cell class="list" v-for="(item,index) of helps" :key="index" :title="item.objector" :inline-desc="item.content_feedback" :link="{name: 'HelpDetail', params: {helpid: item.id}}" v-if="item.objector"></cell>
              </group>
          </div>
    </div>
</template>

<script>
import { XHeader, Group, Cell } from "vux";
import { mapGetters } from "vuex";
export default {
  components: {
    XHeader,
    Group,
    Cell
  },
  computed: {
    ...mapGetters(["personHelps"])
  },
  created() {
    // this.$store.dispatch("getPersonHelps", {
    //   visitor_id: this.$route.params.personid
    // });
  },
  activated() {
    let time = window.sessionStorage.getItem("help_time");
    let start = window.sessionStorage.getItem("help_start");
    let end = window.sessionStorage.getItem("help_end");
    this.$store.dispatch("getPersonHelps", {
      visitor_id: this.$route.params.personid,
      time: time,
      start: start,
      end: end
    });
  },
  watch: {
    personHelps: function(val) {
      this.helps = val;
    }
  },
  data() {
    return {
      helps: []
    };
  },
  methods: {}
};
</script>

<style lang="less">
.person_help {
  width: 100%;
  min-height: 100%;
  font-size: 0;
  background: rgb(245, 245, 249);
  .lesson_lists {
    padding: 2.875rem 0 0;
    .weui-cells {
      margin-top: 0;
    }
    .list {
      width: 100%;
    }
    .vux-cell-primary {
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .vux-label {
      font-size: 1.125rem;
    }
    .vux-label-desc {
      font-size: 0.8125rem;
      color: rgb(102, 102, 102);
    }
  }
}
</style>
